package com.ykq.controller;

import com.ykq.entity.Staff;
import com.ykq.service.MenuService;
import com.ykq.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.Arrays;
import java.util.List;

/**
 * @Author: 闫克起
 * @Description:
 * @Date: Create in 9:15 2024/10/22
 */
@RestController
@RequestMapping("/menu")
public class MenuController {
    @Autowired
    private MenuService menuService;
    @GetMapping("/leftMenu")
    public R leftMenu()
    {
        return menuService.findByStaffId();
    }
    @GetMapping("/listByRoleId")
    public R listByRoleId(Integer roleId)
    {
        return menuService.listByRoleId(roleId);
    }

    @PostMapping("/confirm")
    public R confirm(Integer roleid, Integer[] checkKeys)
    {

        return menuService.confirm(roleid, checkKeys);
    }
}
